package com.example.vedio.controller;

import com.example.vedio.utils.RestMock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lenovo
 */

@RestController
public class VedioController {


    @Autowired
    private RestMock restMock;

    @GetMapping("/run")
    public String run(){
        String login = restMock.login();
        System.out.println(login);
        if(!login.isEmpty()){

            return restMock.run();
        }
        return "no";

    }

    @GetMapping("/stop")
    public String stop(){
        String login = restMock.login();
        System.out.println(login);
        if(!login.isEmpty()){
            restMock.stop();
            return "ok";
        }
        return "no";

    }
}
